#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
#include <string.h>
#include <stdbool.h>

struct plr {
	int val;
	int idx;
};

static long sort_cmp_n = 0L;

/* {{{ mergesort */
static void
mergesort__merge(void *pbase, size_t nmemb, size_t size,
		int (*cmpf)(const void *, const void *),
		void *pcpybuf,
		size_t L, size_t M, size_t R)
{
	register char *base = (char *) pbase,
		      *cpybuf = (char *) pcpybuf;
	register size_t i = L,
			j = M + 1,
			s = 0; /* index
				  points to where we will place next element */

	while (i <= M || j <= R) {
		if ((*cmpf)((void *) (base + i * size),
					(void *) (base + j * size)) < 0) {
			if (i <= M) {
				memcpy((void *) (cpybuf + s * size),
					(void *) (base + i * size), size);
				s++;
				i++;
			} else if (j <= R) {
				memcpy((void *) (cpybuf + s * size),
					(void *) (base + j * size), size);
				s++;
				j++;
			}
		} else {
			if (j <= R) {
				memcpy((void *) (cpybuf + s * size),
					(void *) (base + j * size), size);
				s++;
				j++;
			} else if (i <= M) {
				memcpy((void *) (cpybuf + s * size),
					(void *) (base + i * size), size);
				s++;
				i++;
			}
		}
	}

	i = 0;
	while (i < s) {
		memcpy((void *) (base + (L + i) * size),
			(void *) (cpybuf + i * size), size);
		++i;
	}
}

static void
mergesort__main(void *base, size_t nmemb, size_t size,
		int (*cmpf)(const void *, const void *),
		void *cpybuf,
		size_t L, size_t R)
{
	size_t M = (L + R) / 2;

	if (L < R) {
		mergesort__main(base, nmemb, size, cmpf, cpybuf, L, M);
		mergesort__main(base, nmemb, size, cmpf, cpybuf, M + 1, R);
		mergesort__merge(base, nmemb, size, cmpf, cpybuf, L, M, R);
	}
}

extern void
mergesort(void *base, size_t nmemb, size_t size,
		int (*cmpf)(const void *, const void *))
{
	void *cpybuf = NULL;

	cpybuf = malloc(nmemb * size + 1UL);
	mergesort__main(base, nmemb, size, cmpf, cpybuf,
			0UL, nmemb - 1UL);
	free(cpybuf);
}
/* }}} */

int
cmpplr(const void *p1, const void *p2)
{
	const struct plr *a1 = (const struct plr *) p1,
			 *a2 = (const struct plr *) p2;
	sort_cmp_n++;
	return a1->val - a2->val;
}

int
create_team(const struct plr *players, const int n,
		struct plr **min, struct plr **max)
{
	struct plr *loc_min = *min;
	struct plr *loc_max = *max;
	struct plr *best_min = *min;
	struct plr *best_max = *max;
	int sum  = loc_min->val + loc_max->val;
	int sum1 = loc_min->val + loc_max->val;

	while (loc_max - players < n - 1) {
		if ((loc_max + 1)->val <= loc_min->val + (loc_min + 1)->val) {
			loc_max++;
			sum += loc_max->val;
		} else {
			sum -= loc_min->val;
			loc_min++;

			if (loc_max - loc_min <= 1) {
				loc_max++;
				sum += loc_max->val;
			}
		}

		if (sum1 < sum) {
			best_min = loc_min;
			best_max = loc_max;
			sum1     = sum;
		}
	}

	if (loc_max->val > (loc_min + 1)->val + loc_min->val) {
		sum1 -= loc_min->val;
		best_min++;
	}

	*min = best_min;
	*max = best_max;
	return sum1;
}

int
main(int argc, char **argv)
{
	static struct plr players[100000];
	int n;
	int i, skill;
	struct plr *min, *max;

	scanf("%d", &n);
	for (i = 0; i < n; i++) {
		scanf("%d", &players[i].val);
		players[i].idx = i + 1;
	}

	if (n == 1) {
		printf("1 %d\n1\n", players[0].val);
		goto trivial;
	}

	mergesort(players, (size_t) n, sizeof players[0], cmpplr);

	min = &players[0];
	max = &players[1];
	skill = create_team(players, n, &min, &max);

	printf("%d %d\n", (int) (max - min) + 1, skill);
	for (; min <= max; min++)
		printf("%d\n", min->idx);

trivial:
	fprintf(stderr, "sort_cmp_n=%ld\n", sort_cmp_n);

	return 0;
}
